<template>
  <div class="balance">
    <mt-header :title="list.name">
      <router-link to="/user-haowu" slot="left">
        <mt-button icon="back"></mt-button>
      </router-link>
    </mt-header>
    <div class="haowu-list">
      <mt-cell title="商品名称" :value="list.name"></mt-cell>
      <mt-cell title="商品价格" :value="list.price"></mt-cell>
      <mt-cell title="所在区域" :value="list.area"></mt-cell>
      <mt-cell title="审核状态" :value="list.status"></mt-cell>
      <mt-cell title="介绍" :value="list.introduce"></mt-cell>
      <mt-cell title="图片"></mt-cell>
      <div v-show="list.imgArray">
        <img :src="item" class="haowu-img" v-for="(item, index) of list.imgArray" :key="index">
      </div>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'HaowuItem',
  data () {
    return {
      list: []
    }
  },
  methods: {
    getInfo () {
      axios.get('/meimai/interface/goodsUsed/personalDetail', {
        params: {
          memberId: this.$store.state.userId,
          goodsId: this.$route.params.pid
        }
      }).then((res) => {
        console.log(res)
        let datas = res.data
        if (datas.code === 0) {
          this.list = datas.data
        }
      })
    }
  },
  mounted () {
    this.getInfo()
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl'
@import '~styles/varibles.styl'
.mint-header
  background: $colorRed
.ispicker
  background: rgba(0, 0, 0, .7)
  position: absolute
  top: 0
  width: 100%
  bottom: 0
  z-index: 1
  .picker
    background: #fff
    margin-top: 50%
.haowu-list
  margin-bottom: .3rem
  background: #fff
.spBottom
  width: 100%
  display: flex
  justify-content: space-around
  padding-bottom: .3rem
  background: #fff
  .upimg
    background-color: #f3f3f3
    width: 2.2rem
    height: 1.5rem
    display: flex
    align-items: center
    justify-content: center
    overflow: hidden
    position: relative
    .sptopImg1
      width: 100%
      height: 100%
    .sptopImg2
      height: .5rem
      width: .5rem
    .upimg-item
      position: absolute
      top: 0
      left: 0
      opacity: 0
      width: 100%
      height: 100%
      z-index: 999
.haowuBtn
  box-sizing: border-box
.redColor
  color: red
.haowu-img
  width: 30%
  height: 1.7rem
  padding: .1rem
</style>
